package com.settlement.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.settlement.system.common.annotation.StorePermission;
import com.settlement.system.model.entity.TbOrder;
import com.settlement.system.model.query.TbOrderPageQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 淘宝订单表 Mapper 接口
 * </p>
 *
 * @author huangrensen
 * @since 2023-08-05
 */
@Mapper
public interface TbOrderMapper extends BaseMapper<TbOrder> {

    /**
     * 创建表
     * @param tableName
     * @return
     */
    int createTable(@Param("tableName")String tableName);

    List<TbOrder> getList(TbOrderPageQuery queryParams);

    int insertData(TbOrder tbOrder);

    int update(TbOrder tbOrder);

    @StorePermission
    Page<TbOrder> getPage(Page<TbOrder> page, TbOrderPageQuery queryParams);

    /**
     * 是否存在表
     * @param tableName
     * @return
     */
    String existTable(@Param("tableName")String tableName);
}
